
<template>
  <div>
    <NuxtLayout>
      <DocsMain :storeList="storeList" />
    </NuxtLayout>
  </div>
</template>


<script lang="ts" setup>
import DocsMain from './c-comp/DocsMain.vue'
import { getStoreApi } from '@/service/api'
import { dayjs } from 'element-plus';

const storeList = ref<Store[]>([])
type Store = { [key: string]: any, _id: string }

const getStoreFn = async () => {
  const { data } = await getStoreApi()
  if (data.value?.code !== 200) return ElMessage.error(data.value?.msg)
  storeList.value = data.value?.data.map((store: Store) => {
    return {
      ...store,
      updataTime: dayjs(store.updataTime).format('YYYY-MM-DD')
    }
  })
}
getStoreFn()

</script>

<style scoped lang="scss"></style>
